package net.lab1024.sa.admin.module.business.school.floor.dao;

import java.util.List;

import net.lab1024.sa.admin.module.business.school.floor.domain.entity.FloorEntity;
import net.lab1024.sa.admin.module.business.school.floor.domain.form.FloorQueryForm;
import net.lab1024.sa.admin.module.business.school.floor.domain.vo.FloorVO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

/**
 * 楼层 Dao
 *
 * @Author ZouYang
 * @Date 2024-12-28 12:10:44
 * @Copyright ZouYang
 */

@Mapper
@Component
public interface FloorDao extends BaseMapper<FloorEntity> {

    /**
     * 分页 查询
     *
     * @param page
     * @param queryForm
     * @return
     */
    List<FloorVO> queryPage(Page page, @Param("queryForm") FloorQueryForm queryForm);

    /**
     * 更新删除状态
     */
    long updateDeleted(@Param("id") Long id, @Param("deletedFlag") boolean deletedFlag);

    /**
     * 批量更新删除状态
     */
    void batchUpdateDeleted(@Param("idList") List<Long> idList, @Param("deletedFlag") boolean deletedFlag);

    /**
     * 批量插入数据
     * @param list
     */
    void batchInsert(@Param("list") List<FloorEntity> list);
    List<FloorEntity> selectByDormitoryId(@Param("dormitoryId") Long dormitoryId);

}
